<template>
  <div class="relevantmv">
      <div class="item" v-for="item of singermv" :key="item.id" @click="handeleClick(item.id)">
          <img :src="item.imgurl" alt="">
          <p>{{item.name | handleString}}</p>
      </div>
  </div>
</template>

<script>
export default {
    data() {
        return {
            singermv:[]
        }
    },
    mounted() {
        var {id} = this.$route.query
        this.$http.get(`/artist/mv?id=${id}`).then(res=>{
            this.singermv = res.data.mvs.slice(0,8)
        })
    },
    methods:{
        handeleClick(val){
            console.log(val);
            this.$router.push(`/mvdetail?id=${val}`)
        }
    }
}
</script>

<style scoped>
.relevantmv {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}
.item {
    margin: 20px 10px;
}
.item img {
    width: 150px;
    height: 100px;
}
</style>